Method for code transformation supporting temporal abstraction of parameters

ABSTRACT

A method of code transformation supporting temporal abstraction of parameters is provided herein. The method includes the following stages: extracting a set of statements from an original code and further creating a residual code being the original code without the statements, wherein two or more of the extracted statements are not on a same loop in the original code; adding conditions from the original code to the extracted set of statements, such that the added conditions are sufficient to render the set of statements executable; adding statements from the original code to the residual code, such that the added statements are sufficient to render the residual code executable; and adding code portions and variables to the set of statements and the residual code, such that a passing of values between the enhanced set of statements and the residual code maintains a respective passing of values in the original code.

BACKGROUND

1. Technical Field

The present invention relates to computer code transformation and moreparticularly, to computer code transformation that supports extractionof statements that are not on the same loop.

2. Discussion Of The Related Art

As the amount of legacy computer code accumulates, hundreds of thousandsof code lines are imposing a real challenge for programmers both in codereadability and code reuse terms. In order to use portions of legacycode, it becomes crucial for programmers to be able to separate theseportions of code lines (or statements) that are associated with a singleoperation so that the extracted statements may be either reused orreplaced in their entirety by a newer version.

One known solution for separating code statements from an original codeis called the Extract Method refactoring. This method can be useful byitself, or as a building block in larger refactoring tasks. Because itrequires a deep analysis of data and control dependences, it isdifficult to perform correctly without tools in complicated cases.Unfortunately, refactoring tools do not perform the required analysis,and will fail in or reject such cases. Some very useful cases, such asthose involving non-contiguous code, cannot even be expressed usingthese tools' interfaces.

BRIEF SUMMARY

One aspect of the invention provides a method the includes the followingstages: (i) extracting a set of statements from an original code, basedon user selection, to yield an extracted set of statements and aresidual code that includes the original code without the statements,wherein two or more of the extracted statements are not on a same loopin the original code; (ii) adding conditions from the original code tothe extracted set of statements, to yield an enhanced set of statements,such that the added conditions are sufficient to render the enhanced setof statements executable while preserving semantics of the originalcode; (iii) adding statements from the original code to the residualcode, to yield an enhanced residual code, such that the added statementsare sufficient to render the residual code executable while preservingsemantics of the original code; (iv) adding code portions and variablesto the enhanced set of statements and the enhanced residual code, suchthat a passing of values between the enhanced set of statements and theresidual code maintains a respective passing of values in the originalcode; an (v) determining a location in the enhanced residual code for aninsertion of a call to the enhanced set of statements, wherein at leastone of the aforementioned stages is carried out by at least oneprocessor.

Other aspects of the invention may include a system arranged to executethe aforementioned method and a computer readable program configured toexecute the stages of the aforementioned method. These, additional,and/or other aspects and/or advantages of the embodiments of the presentinvention are set forth in the detailed description which follows;possibly inferable from the detailed description; and/or learnable bypractice of the embodiments of the present invention.

BRIEF DESCRIPTION OF THE DRAWINGS

For a better understanding of embodiments of the invention and to showhow the same may be carried into effect, reference will now be made,purely by way of example, to the accompanying drawings in which likenumerals designate corresponding elements or sections throughout.

In the accompanying drawings:

FIG. 1 is a high level schematic block diagram illustrating a systemaccording to some embodiments of the invention;

FIG. 2 is a high level flowchart illustrating a method according to someembodiments of the invention;

FIG. 3 is an exemplary code illustrating an aspect according to someembodiments of the invention;

FIG. 4 is a graph diagram illustrating an aspect according to someembodiments of the invention;

FIG. 5 is a graph diagram illustrating an aspect according to someembodiments of the invention;

FIG. 6 is a graph diagram illustrating an aspect according to someembodiments of the invention;

FIG. 7 shows exemplary codes illustrating an aspect according to someembodiments of the invention; and

FIG. 8 is an exemplary code illustrating an aspect according to someembodiments of the invention;

The drawings together with the following detailed description makeapparent to those skilled in the art how the invention may be embodiedin practice.

DETAILED DESCRIPTION

Prior to setting forth the detailed description, it may be helpful toset forth definitions of certain terms that will be used hereinafter.

The term “program slicing” or “code slicing” as used herein in thisapplication refers to the computation of the set of programs statements,the program slice, that may affect the values at some point of interest,referred to as a slicing criterion. Program slicing can be used indebugging to locate source of errors more easily. Other applications ofslicing include software maintenance, optimization, program analysis,and information flow control.

The term “code refactoring” as used herein in this application refers torestructuring code according to a specified policy undertaken in orderto improve some of the nonfunctional attributes of the software.Typically, this is carried out by applying series of “refactorings”,each of which is a change in a computer program's source code that doesnot modify its functional behavior. Advantages include improved codereadability and reduced complexity to improve the maintainability of thesource code, as well as a more expressive internal architecture orobject model to improve extensibility.

With specific reference now to the drawings in detail, it is stressedthat the particulars shown are by way of example and for purposes ofillustrative discussion of the preferred embodiments of the presentinvention only, and are presented in the cause of providing what isbelieved to be the most useful and readily understood description of theprinciples and conceptual aspects of the invention. In this regard, noattempt is made to show structural details of the invention in moredetail than is necessary for a fundamental understanding of theinvention, the description taken with the drawings making apparent tothose skilled in the art how the several forms of the invention may beembodied in practice.

Before explaining at least one embodiment of the invention in detail, itis to be understood that the invention is not limited in its applicationto the details of construction and the arrangement of the components setforth in the following description or illustrated in the drawings. Theinvention is applicable to other embodiments or of being practiced orcarried out in various ways. Also, it is to be understood that thephraseology and terminology employed herein is for the purpose ofdescription and should not be regarded as limiting.

FIG. 1 is a high level schematic block diagram illustrating a systemaccording to some embodiments of the invention. System 100 may be incommunication via a network 40 with at least one computer 30 associatedwith a user interface 20 and a user 10. User 10 is not necessarily ahuman user and system 100 may be a part of a larger automated system.

System 100 may include: an extractor 110 configured to extract a set ofstatements from an original code 50, based on user 10 selection madeover user interface 20, to yield an extracted set of statements 114 anda residual code 112 that includes the original code without thestatements, wherein two or more of the extracted statements are not on asame loop in the original code. System 100 may further include astatement enhancer 120 configured to add conditions from the originalcode 50 to the extracted set of statements 114, to yield an enhanced setof statements 122, such that the added conditions are sufficient torender the enhanced set of statements 122 executable while preservingsemantics of the original code. System 100 may further include aresidual code enhancer 130 configured to add statements from theoriginal code 50 to the residual code 112, to yield an enhanced residualcode 132, such that the added statements are sufficient to render theenhanced residual code 132 executable while preserving semantics of theoriginal code. System 100 may further include a data flow enhancer 140configured to add code portions and variables to the enhanced set ofstatements and the enhanced residual code, such that a passing of values144 between the enhanced set of statements with the added data flow 146and the residual code with the added data flow 142 maintains arespective passing of values in the original code. System 100 mayfurther includes a call locator 150 configured to determine a location152 in the enhanced residual code 142 for an insertion of a call to theenhanced set of statements 146. It is noted that any of the statementenhancer 120, the residual code enhancer 130, the data flow enhancer140, and the call locator 150 are in operative association with at leastone processor (not shown).

Consistent with some embodiments of the present invention, in order tomake the set of statements 114 executable, it is necessary to add someconditions from original code 50. This is carried out by several substeps as follows: (i) Add to set of statements 114 the lowest statementin original code 50 that dominates set of statements 114. The loweststatement is denoted herein as S_(min); (ii) Add to set of statements114 the highest location in original code 50 that postdominates set ofstatements 114. The highest location is denoted herein this location asS_(max); (iii) Add to set of statements 114 all conditions from originalcode 50 that are on a path from some q in set of statements 114 to q′ inset of statements 114 where q′ is control-dependent on the conditions,except when q=S_(max) and q′=S_(min), wherein data on which any of theconditions depends on is not added; and (iv) Repeat sub steps (i)-(iii)taking into account the new statements added each time, until there isno change.

It is noted that in step (i) the lowest statement is the one that isdominated by all other statements in original code 50 that dominate allthe statements in set of statements 114. Similarly, in step (ii) thehighest statement is the one that is postdominated by all otherstatements in original code 50 that postdominate all statements in setof statements 114. In step (iv) this computation is iterated forunstructured programs (including unstructured constructs in so-calledstructured languages). Sub step (iii) excludes paths from S_(max) toS_(min), since these correspond to loops that contain the whole S, andshould not be included in it. When S is extracted, the call will appearinside any such loops.

Consistent with some embodiments of the invention, at least some of thepassing of values between the residual code and the extracted set ofstatements includes streaming a sequence of values as parameters.Consistent with some embodiments of the invention, the statementsenhancer is configured to produce the enhanced set of statements by: (i)adding to the extracted set of statements, a lowest statement in theoriginal code that dominates the set of statements; (ii) adding to theextracted set of statements a highest location in the original code thatpostdominates the set of statements; and (iii) adding to the extractedset of statements all the conditions from the original code that are ona control path from the highest location to the lowest statement, suchthat the lowest statement depends on the added conditions, wherein datathat depends on the added conditions is not added.

Consistent with some embodiments of the invention, residual codeenhancer is configured to produce the enhanced residual code by applyinga backward slicing to the graph of the original code that stops at everyvariable use that gets its value from locations that designate values tobe returned from the extracted set of statements, wherein the slicing isbased on a slicing criteria that includes all the statements in theresidual code.

Consistent with some embodiments of the invention, data flow enhancer isconfigured to select a specified location for adding a value to asequence that will be passed as a parameter, as a location in theoriginal code that is present in the extracted set of statements or theresidual code but whose control predecessor is not present in theextracted set of statements or the residual code respectively, whereinthat all control paths from a source of an uninitialized value to anuninitialized value pass through the specified location.

More specifically, as both enhanced set of statements 122 and enhancedresidual code 132 contain uninitialized variables it is necessary fordata flow enhancer 140 to determine the parameters and return value.Some of the parameters will remain scalar variables as in the originalprogram. However, some of the variables need to get sequences of valuesas parameters. Data flow enhancer 140 will add the necessary code forpassing the parameters and return values. Data flow enhancer 140operates under the following observations in order to identifyparameters that do not require sequences:

In an enhanced set of statements 122 and enhanced residual code 132, Letv be an uninitialized variable location in enhanced set of statements122 (respectively enhanced residual code 132) whose source is inenhanced residual code 132 (respectively enhanced set of statements122), and will be denoted as vs. Let SCC(v) be the strongly connectedcomponent in enhanced set of statements 122 (respectively, enhancedresidual code 132) that contains v. Let SCC(v)′ be the stronglyconnected component in original code 50 (respectively, enhanced residualcode 132) that contains v. A sequence of values is needed for v if andonly if SCC(v)′ contains vs.

In order to compute the location for adding a value to a sequence thatwill be passed as a parameter, it is necessary to locate the uniqueplace where the data passes into enhanced set of statements 122(respectively enhanced residual code 132). This place is represented bya location 1 in original code 50 that is in enhanced set of statements122 (respectively enhanced residual code 132) but whose controlpredecessor not in enhanced set of statements 122 (respectively enhancedresidual code 132), such that all control paths from vs to v passthrough that location.

Applicants have discovered that it is possible to prove that such anlocation always exists, and that it is the same for all uninitializedvariable location of enhanced set of statements 122 (respectivelyenhanced residual code 132) that receive their values from vs. If anenqueue operation is inserted to original code 50 at location 1immediately followed by a dequeue operation on the same queue, replacingthe use of v with the use of the value returned by the dequeueoperation, it is clear that the behavior of the original program ispreserved. The queue will always be empty, except immediately betweenthe two added operations.

When set of statements 122 is separated from enhanced residual code 132the dequeue operation should be first added to enhanced set ofstatements 122 (respectively enhanced residual code 132). The enqueueoperation will remain with enhanced residual code 132 (respectivelyenhanced set of statements 122) while the dequeue operation will beincluded with the extracted enhanced set of statements 122 (respectivelyenhanced residual code 132) This will change the behavior of the programso that all enqueue operations will be performed by enhanced residualcode 132 (respectively enhanced set of statements 122) before passingthe queue to enhanced set of statements 122 (respectively enhancedresidual code 132), which will then dequeue the elements one by oneuntil the queue is empty. It is possible to show that the originalsemantics of the program is preserved by this transformation.

Consistent with some embodiments of the invention, call locator isconfigured to determine the location such that it satisfies all of: (i)the location is contained in exactly a number of control cycles as ahighest location in the original code that postdominates the set ofstatements; (ii) the location is dominated by all sources of parametersto the enhanced extracted set of statement; (iii) every path from thelocation to any of added enqueue operations passes through a loweststatement in the original code that dominates the set of statements; and(iv) the location dominates each statements containing uninitializedvariables in the residual code.

Condition (i) ensures that the call will be executed the same number oftimes as the extracted code was in the original program. Conditions (ii)and (iii) ensure that all parameters will be ready before the call(since passing through S_(min) initiates a new pass through theextracted code). It is noted that the control successor of S_(max)satisfies the first three conditions, and the call can always be placedthere (unless there are results to be returned from the extracted codeto the enhanced residual code).

Consistent with some embodiments of the invention, system 100 furtherincludes a graph generator 160 configured to generating graphsrepresentative of at least one of: the original code, the extracted setof statements, the residual code, the enhanced set of statements, andthe enhances residual code, wherein each graph includes all controlpaths and data paths separately. This may facilitate the implementationof the enhancers 120, 130, and 140. However, it is noted that the use ofgraphs is non-limiting and embodiments of the present invention may becarried out using different code representations.

Consistent with some embodiments of the invention, call locator isfurther configured to add the call to the enhanced extracted set ofstatements to the enhanced residual code, at the determined location.

FIG. 2 is a high level flowchart illustrating a method according to someembodiments of the invention. Method 200 may include the followingstages: selecting: (i) a set of statements to be extracted and (ii)expressions that need to be received rather than computed 210;extracting a set of statements from an original code, based on userselection, to yield an extracted set of statements and a residual codethat includes the original code without the statements, wherein two ormore of the extracted statements are not on a same loop in the originalcode 220; adding conditions from the original code to the extracted setof statements, to yield an enhanced set of statements, such that theadded conditions are sufficient to render the enhanced set of statementsexecutable while preserving semantics of the original code 230; addingstatements from the original code to the residual code, to yield anenhanced residual code, such that the added statements are sufficient torender the residual code executable while preserving semantics of theoriginal code 240; adding code portions and variables to the enhancedset of statements and the enhanced residual code, such that a passing ofvalues between the enhanced set of statements and the residual codemaintains a respective passing of values in the original code 250; anddetermining a location in the enhanced residual code for an insertion ofa call to the enhanced set of statements 260. Optionally, the extractedset of statements may be aggregated and located together in a singlespecified location.

Optionally, method 200 may further include the stage of inserting a callto the enhanced extracted set of statements to the enhanced residualcode, at the determined location 270.

The reminder of description illustrates a non-limiting implementation ofembodiments of the present invention on an exemplary computer code.Consistent with some embodiments, the original code, the residual code,and the extracted statements are also represented as graphs. Asexplained above, other implementations that do not require the use ofgraphs may also be used in order to carry put embodiments of the presentinvention.

FIG. 3 is exemplary original code 300 which serves as the input ofembodiments of the present invention; FIG. 4 is a graph diagram 400representing original code 300; FIG. 5 is a graph diagram 500representing the extracted set of statements; FIG. 6 is a graph diagram600 representing the residual code; FIG. 7 is exemplary codesillustrating an aspect according to some embodiments of the invention;and FIG. 8 is an exemplary code illustrating an aspect according to someembodiments of the invention.

Original code 300 is a code of a program that tangles the logic offetching the pictures to be shown with their presentation in HTMLformat. In the following non-limiting example, a user wishes to separatethe statements that relate to the display, 310-340 from original code300. As clearly shown, statements 310-340 are not on the same loop andtherefore the extracted set of statement in non-contiguous.

Graph 400 shows a graph representation of original code 300 in whichgraphic representation of statements to be extracted 410 and 420correspond with statements 310-340 of code 300. Graph 500 shows graphicrepresentation of extracted statements 410 and 420 showing S_(min) andS_(max) used as upper and lower limits for determining the conditionsthat need to be imported from original code 300 as explained above.Condition 510 is such a condition that has been added in order to renderthe set of statements executable while preserving the semantics of theoriginal code. In addition, expressions 530, 532, 534, 536, and 538receive the corresponding values from the residual code, whereasexpression 540 is passed as a parameter to the residual code.

Graph 600 is representative of the semantics of the residual code.Statement 610 is a condition imported from original code 300 asexplained above, to render the residual code executable while preservingthe semantics of the original code. In addition, expression 642,receives the corresponding values from the set of statements, whereasexpressions 630, 632, 634, 636, and 638 are passed as parameters to theset of statements. FIG. 7 show the enhanced set of statements (with theadded conditions) 710 and the enhanced residual code (with theadditional statement) 720. Lastly, FIG. 8 shows the final code 800 witha separated residual code and set of statements, and a call to the setof statements as a function call in the determined location in residualcode.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more non-transitory computer readablemedium(s) may be utilized. The non-transitory computer readable mediummay be a non-transitory computer readable signal medium or anon-transitory computer readable storage medium. A non-transitorycomputer readable storage medium may be, for example, but not limitedto, an electronic, magnetic, optical, electromagnetic, infrared, orsemiconductor system, apparatus, or device, or any suitable combinationof the foregoing. More specific examples (a non-exhaustive list) of thecomputer readable storage medium would include the following: anelectrical connection having one or more wires, a portable computerdiskette, a hard disk, a random access memory (RAM), a read-only memory(ROM), an erasable programmable read-only memory (EPROM or Flashmemory), an optical fiber, a portable compact disc read-only memory(CD-ROM), an optical storage device, a magnetic storage device, or anysuitable combination of the foregoing. In the context of this document,a computer readable storage medium may be any tangible medium that cancontain, or store a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a non-transitory computer readable medium maybe transmitted using any appropriate medium, including but not limitedto wireless, wire-line, optical fiber cable, RF, etc., or any suitablecombination of the foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described above with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in anon-transitory computer readable medium that can direct a computer,other programmable data processing apparatus, or other devices tofunction in a particular manner, such that the instructions stored inthe computer readable medium produce an article of manufacture includinginstructions which implement the function/act specified in the flowchartand/or block diagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The aforementioned flowchart and diagrams illustrate the architecture,functionality, and operation of possible implementations of systems,methods and computer program products according to various embodimentsof the present invention. In this regard, each block in the flowchart orblock diagrams may represent a module, segment, or portion of code,which comprises one or more executable instructions for implementing thespecified logical function(s). It should also be noted that, in somealternative implementations, the functions noted in the block may occurout of the order noted in the figures. For example, two blocks shown insuccession may, in fact, be executed substantially concurrently, or theblocks may sometimes be executed in the reverse order, depending uponthe functionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts, or combinations of special purpose hardware andcomputer instructions.

In the above description, an embodiment is an example or implementationof the inventions. The various appearances of “one embodiment,” “anembodiment” or “some embodiments” do not necessarily all refer to thesame embodiments.

Although various features of the invention may be described in thecontext of a single embodiment, the features may also be providedseparately or in any suitable combination. Conversely, although theinvention may be described herein in the context of separate embodimentsfor clarity, the invention may also be implemented in a singleembodiment.

Reference in the specification to “some embodiments”, an “embodiment”,“one embodiment” or “other embodiments” means that a particular feature,structure, or characteristic described in connection with theembodiments is included in at least some embodiments, but notnecessarily all embodiments, of the inventions.

It is to be understood that the phraseology and terminology employedherein is not to be construed as limiting and are for descriptivepurpose only.

The principles and uses of the teachings of the present invention may bebetter understood with reference to the accompanying description,figures and examples.

It is to be understood that the details set forth herein do not construea limitation to an application of the invention.

Furthermore, it is to be understood that the invention can be carriedout or practiced in various ways and that the invention can beimplemented in embodiments other than the ones outlined in thedescription above.

It is to be understood that the terms “including”, “comprising”,“consisting” and grammatical variants thereof do not preclude theaddition of one or more components, features, steps, or integers orgroups thereof and that the terms are to be construed as specifyingcomponents, features, steps or integers.

If the specification or claims refer to “an additional” element, thatdoes not preclude there being more than one of the additional element.

It is to be understood that where the claims or specification refer to“a” or “an” element, such reference is not be construed that there isonly one of that element.

It is to be understood that where the specification states that acomponent, feature, structure, or characteristic “may”, “might”, “can”or “could” be included, that particular component, feature, structure,or characteristic is not required to be included.

Where applicable, although state diagrams, flow diagrams or both may beused to describe embodiments, the invention is not limited to thosediagrams or to the corresponding descriptions. For example, flow neednot move through each illustrated box or state, or in exactly the sameorder as illustrated and described.

Methods of the present invention may be implemented by performing orcompleting manually, automatically, or a combination thereof, selectedsteps or tasks.

The descriptions, examples, methods and materials presented in theclaims and the specification are not to be construed as limiting butrather as illustrative only.

Meanings of technical and scientific terms used herein are to becommonly understood as by one of ordinary skill in the art to which theinvention belongs, unless otherwise defined.

The present invention may be implemented in the testing or practice withmethods and materials equivalent or similar to those described herein.

Any publications, including patents, patent applications and articles,referenced or mentioned in this specification are herein incorporated intheir entirety into the specification, to the same extent as if eachindividual publication was specifically and individually indicated to beincorporated herein. In addition, citation or identification of anyreference in the description of some embodiments of the invention shallnot be construed as an admission that such reference is available asprior art to the present invention.

While the invention has been described with respect to a limited numberof embodiments, these should not be construed as limitations on thescope of the invention, but rather as exemplifications of some of thepreferred embodiments. Other possible variations, modifications, andapplications are also within the scope of the invention. Accordingly,the scope of the invention should not be limited by what has thus farbeen described, but by the appended claims and their legal equivalents.

What is claimed is:
 1. A method comprising: extracting a set ofstatements from an original code, based on user selection, to yield anextracted set of statements and a residual code that includes portionsof the original code, wherein two or more of the extracted statementsare not on a same loop in the original code; adding conditions from theoriginal code to the extracted set of statements, to yield an enhancedset of statements, such that the added conditions are sufficient torender the enhanced set of statements executable while preservingsemantics of the original code; adding statements from the original codeto the residual code, to yield an enhanced residual code, such that theadded statements are sufficient to render the enhanced residual codeexecutable while preserving semantics of the original code; adding codeportions and a stream of variables to the enhanced set of statements andto the enhanced residual code, such that the data flow between theenhanced set of statements and the enhanced residual code is defined bythe data flow in the original code coupled with streaming of data basedon the stream of variables; generating a call to the set of statementsfrom the enhanced residual code, the call for executing the enhanced setof statements; and determining a location in the enhanced residual codefor an insertion of the call to the enhanced set of statements, whereinat least one of: the extracting, any of the adding, the generating, andthe determining is carried out by at least one processor, wherein in thedetermining, the location is selected such that it satisfies all of: (i)the location is contained in exactly a number of control cycles as ahighest location in the original code that postdominates the set ofstatements; (ii) the location is dominated by all sources of parametersto the enhanced extracted set of statement; (iii) every path from thelocation to any of added enqueue operations pass through a loweststatement in the original code that dominates the set of statements; and(iv) the location dominates each statements containing uninitializedvariables in the residual code.
 2. The method according to claim 1,wherein the enhanced set of statements is achieved by: (i) adding to theextracted set of statements, a lowest statement in the original codethat dominates the set of statements; (ii) adding to the extracted setof statements a highest location in the original code that postdominatesthe set of statements; and (iii) adding to the extracted set ofstatements all the conditions from the original code that are on acontrol path from the highest location to the lowest statement, suchthat the lowest statement depends on the added conditions, wherein datathat depends on the added conditions is not added.
 3. The methodaccording to claim 2, further comprising repeating the adding of thelowest statement, the adding of the highest location, and the adding ofall the conditions, while taking into account the new statements addedeach time, until there is no further change after each one of theadding.
 4. The method according to claim 1, wherein the enhancedresidual code is achieved by applying a backward slicing to the originalcode that stops at every variable use that gets its value from locationsthat designate values to be returned from the extracted set ofstatements, wherein the slicing is based on a slicing criteria thatincludes all the statements in the residual code.
 5. The methodaccording to claim 1, wherein in the passing of values between theenhanced set of statements and the residual code, a specified locationfor adding a value to a sequence that will be passed as a parameter, isselected as a location in the original code that is present in theextracted set of statements or the residual code but whose controlpredecessor is not present in the extracted set of statements or theresidual code respectively, wherein all control paths from a source ofan uninitialized value to an uninitialized value pass through thespecified location.
 6. The method according to claim 1, furthercomprising generating graphs representative of at least one of: theoriginal code, the extracted set of statements, the residual code, theenhanced set of statements, and the enhances residual code, wherein eachgraph includes all control paths and data paths separately.
 7. Themethod according to claim 1, further comprising adding a the call to theenhanced extracted set of statements to the enhanced residual code, atthe determined location.
 8. A system comprising: an extractor configuredto extract a set of statements from an original code, based on userselection, to yield an extracted set of statements and a residual codethat includes portions of the original code, wherein two or more of theextracted statements are not on a same loop in the original code; astatement enhancer configured to add conditions from the original codeto the extracted set of statements, to yield an enhanced set ofstatements, such that the added conditions are sufficient to render theenhanced set of statements executable while preserving semantics of theoriginal code; a residual code enhancer configured to add statementsfrom the original code to the residual code, to yield an enhancedresidual code, such that the added statements are sufficient to renderthe residual code executable while preserving semantics of the originalcode; a data flow enhancer configured to add code portions and a streamof variables to the enhanced set of statements and the enhanced residualcode, such that the data flow between the enhanced set of statements andthe enhanced residual code is defined by the data flow in the originalcode coupled with streaming of data based on the stream of variables; acall generator for generating a call to the set of statements from theenhanced residual code, the call for executing the enhanced set ofstatements; and a call locator configured to determine a location in theenhanced residual code for an insertion of the call to the enhanced setof statements, and, at least one processor programmed to operate thestatements enhancer, the residual code enhancer, the data flow enhancer,the call generator, and the call locator, wherein the call locator isconfigured to determine the location such that it satisfies all of: (i)the location is contained in exactly a number of control cycles as ahighest location in the original code that postdominates the set ofstatements; (ii) the location is dominated by all sources of parametersto the enhanced extracted set of statement; (iii) every path from thelocation to any of added enqueue operations pass through a loweststatement in the original code that dominates the set of statements; and(iv) the location dominates each statements containing uninitializedvariables in the residual code.
 9. The system according to claim 8,wherein the statements enhancer is configured to produce the enhancedset of statements by: (i) adding to the extracted set of statements, alowest statement in the original code that dominates the set ofstatements; (ii) adding to the extracted set of statements a highestlocation in the original code that postdominates the set of statements;and (iii) adding to the extracted set of statements all the conditionsfrom the original code that are on a control path from the highestlocation to the lowest statement, such that the lowest statement dependson the added conditions, wherein data that depends on the addedconditions is not added.
 10. The system according to claim 9, whereinthe statement enhancer is further configured to repeat the adding of thelowest statement, the adding of the highest location, and the adding ofall the conditions, while taking into account the new statements addedeach time, until there is no further change after each one of theadding.
 11. The system according to claim 8, wherein the residual codeenhancer is configured to produce the enhanced residual code by applyinga backward slicing to the graph of the original code that stops at everyvariable use that gets its value from locations that designate values tobe returned from the extracted set of statements, wherein the slicing isbased on a slicing criteria that includes all the statements in theresidual code.
 12. The system according to claim 8, wherein the dataflow enhancer is configured to select a specified location for adding avalue to a sequence that will be passed as a parameter, as a location inthe original code that is present in the extracted set of statements orthe residual code but whose control predecessor is not present in theextracted set of statements or the residual code respectively, whereinthat all control paths from a source of an uninitialized value to anuninitialized value pass through the specified location.
 13. The systemaccording to claim 8, further comprising a graph generator configured togenerating graphs representative of at least one of: the original code,the extracted set of statements, the residual code, the enhanced set ofstatements, and the enhances residual code, wherein each graph includesall control paths and data paths separately.
 14. The system according toclaim 8, wherein the call locator is further configured to add the callto the enhanced extracted set of statements to the enhanced residualcode, at the determined location.
 15. A computer program product forcode transformation supporting temporal abstraction of parameters, thecomputer program product comprising: a non-transitory computer readablestorage medium which is not a signal having computer readable programembodied therewith, the computer readable program comprising: computerreadable program code configured to extract a set of statements from anoriginal code, based on user selection, to yield an extracted set ofstatements and a residual code that includes portions of the originalcode, wherein two or more of the extracted statements are not on a sameloop in the original code; computer readable program code configured toadd conditions from the original code to the extracted set ofstatements, to yield an enhanced set of statements, such that the addedconditions are sufficient to render the enhanced set of statementsexecutable while preserving semantics of the original code; computerreadable program code configured to add statements from the originalcode to the residual code, to yield an enhanced residual code, such thatthe added statements are sufficient to render the residual codeexecutable while preserving semantics of the original code; computerreadable program code configured to add code portions and a stream ofvariables to the enhanced set of statements and the enhanced residualcode, such that the data flow between the enhanced set of statements andthe enhanced residual code is defined by the data flow in the originalcode coupled with streaming of data based on the stream of variables;computer readable program code for generating a call to the set ofstatements from the enhanced residual code, the call for executing theenhanced set of statements; and computer readable program configured todetermine a location in the enhanced residual code for an insertion ofthe call to the enhanced set of statements comprising computer readableprogram code configured to determine the location such that it satisfiesall of: (i) the location is contained in exactly a number of controlcycles as a highest location in the original code that postdominates theset of statements; (ii) the location is dominated by all sources ofparameters to the enhanced extracted set of statement; (iii) every pathfrom the location to any of added enqueue operations pass through alowest statement in the original code that dominates the set ofstatements; and (iv) the location dominates each statements containinguninitialized variables in the residual code.
 16. The computer programproduct according to claim 15, further comprising computer readableprogram code configured to produce the enhanced set of statements by:(i) adding to the extracted set of statements, a lowest statement in theoriginal code that dominates the set of statements; (ii) adding to theextracted set of statements a highest location in the original code thatpostdominates the set of statements; and (iii) adding to the extractedset of statements all the conditions from the original code that are ona control path from the highest location to the lowest statement, suchthat the lowest statement depends on the added conditions, wherein datathat depends on the added conditions is not added.
 17. The computerprogram product according to claim 16, further comprising computerreadable program code configured to repeat the adding of the loweststatement, the adding of the highest location, and the adding of all theconditions, while taking into account the new statements added eachtime, until there is no further change after each one of the adding. 18.The computer program product according to claim 15, further comprisingcomputer readable program code configured to produce the enhancedresidual code by applying a backward slicing to the graph of theoriginal code that stops at every variable use that gets its value fromlocations that designate values to be returned from the extracted set ofstatements, wherein the slicing is based on a slicing criteria thatincludes all the statements in the residual code.
 19. The computerprogram product according to claim 15, further comprising computerreadable program code configured to select a specified location foradding a value to a sequence that will be passed as a parameter, as alocation in the original code that is present in the extracted set ofstatements or the residual code but whose control predecessor is notpresent in the extracted set of statements or the residual coderespectively, wherein that all control paths from a source of anuninitialized value to an uninitialized value pass through the specifiedlocation.
 20. The computer program product according to claim 15,further comprising computer readable program code configured to generategraphs representative of at least one of: the original code, theextracted set of statements, the residual code, the enhanced set ofstatements, and the enhances residual code, wherein each graph includesall control paths and data paths separately.
 21. The computer programproduct according to claim 15, further comprising computer readableprogram code configured to add the call to the enhanced extracted set ofstatements to the enhanced residual code, at the determined location.